#include <iostream>
#include <stdlib.h>
#include <cstring>
#include <fstream>
using namespace std;

char* GetFileExtenstion (char * file_name)
{ 
     int file_name_len = strlen (file_name); 
     file_name +=file_name_len ;
 
     char *file_ext ;
     for(int i =0 ; i <file_name_len ; i ++)
     {
            if(* file_name == '.' )
            {
                file_ext = file_name +1 ;
                 break;
            } 
           file_name --;
     } 
     return file_ext ;
}


int main(int argc, char *argv[])
{
	const char* filename = "file.raw";
	char* ext = GetFileExtenstion( const_cast<char*>(filename) );

	cout << ext << endl;
	cout << filename << endl;

	char _ext[10];
	_splitpath( filename, 0, 0, 0, _ext );
	cout << ext << endl;
	return 0;
}
